package com.zlp.spring.v4.config;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

/**
 * 自定义逻辑返回需要导入的组件
 * @date: 2021/2/25 18:15
 */
public class MyImportSelector implements ImportSelector {

    /**
     * 导入容器集合
     * @param importingClassMetadata 当前标注@Import注解的类的所有注解信息
     * @date: 2021/2/25 18:15
     * @return: java.lang.String[] 返回值，就是到导入到容器中的组件全类名
     */
    public String[] selectImports(AnnotationMetadata importingClassMetadata) {

        return new String[]{"com.zlp.spring.v4.entity.Red","com.zlp.spring.v4.entity.Green"};
    }
}
